import java.util.Random;
import java.util.Scanner;

/**
 * 玩家对象：
 *      属性：
 *          winCount 赢了几局
 *          fit 拳
 *          rule 角色
 *      行为：
 *          chooseRule() 选择角色 刘备  孙权 曹操
 *          showFit()  出拳
 */
public class Player {

    public int winCount;
    String fit;
    String rule;

    public void chooseRule(){
        System.out.println("请选择角色：1.刘备  2.孙权 3.曹操");

        Scanner scanner = new Scanner(System.in);
        int inputInt = scanner.nextInt();

        switch (inputInt){
            case 1:
                rule ="刘备";
                break;
            case 2:
                rule = "孙权";
                break;
            case 3:
                rule = "曹操";
                break;
            default:
                System.out.println("输入有误，请重新选择!");
                //递归调用自己
                chooseRule();
        }
    }

    public String showFit(){
        //提示需要玩家选择 石头、剪刀、布
        System.out.println("请选择：1、石头；2、剪刀；3、布");

        Scanner scanner = new Scanner(System.in);
        String choose = scanner.next();

        if(!"#".equals(choose)){

            int chooseInt = Integer.parseInt(choose);

            switch (chooseInt){
                case 1:
                    fit = "石头";
                    break;
                case 2:
                    fit = "剪刀";
                    break;
                case 3:
                    fit = "布";
                    break;
            }
        }

        return fit;
    }
}
